package com.jinglin.web.controller;


import com.jinglin.controller.ABaseController;
import com.jinglin.entity.dto.TokenUserInfoDto;
import com.jinglin.entity.po.VideoPlayHistory;
import com.jinglin.entity.vo.PaginationResultVO;
import com.jinglin.entity.vo.ResponseVO;
import com.jinglin.service.VideoPlayHistoryService;
import org.apache.coyote.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 视频播放历史 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2025-04-03
 */
@RestController
@RequestMapping("/history")
public class VideoPlayHistoryController  extends ABaseController {
    @Autowired
    private VideoPlayHistoryService videoPlayHistoryService;
    @RequestMapping("/loadHistory")
    public ResponseVO loadHistory(Integer pageNo){
        TokenUserInfoDto tokenUserInfoDto = getTokenUserInfoDto();
        PaginationResultVO paginationResultVO = videoPlayHistoryService.loadHistory(tokenUserInfoDto.getUserId(), pageNo);
        return  getSuccessResponseVO(paginationResultVO);
    }
}

